package com.dmooo.ymx.adapter;

import android.content.Context;
import android.view.View;

import com.dmooo.ymx.R;
import com.dmooo.ymx.bean.Temp;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

public class AttendRecordAdapter2 extends CommonAdapter<Temp.Items> {
    public AttendRecordAdapter2(Context context, int layoutId, List<Temp.Items> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, Temp.Items attendRecordBean, int position) {
        holder.setText(R.id.tv_one, attendRecordBean.action_zh);
        holder.setText(R.id.tv_two, attendRecordBean.action_symbol+ attendRecordBean.point);
        holder.setText(R.id.tv_three, "日期:"+attendRecordBean.create_time);
        holder.setText(R.id.tv_four, "积分:"+attendRecordBean.all_point);
        if(attendRecordBean.action.startsWith("transfer")){
            holder.getView(R.id.ll_top).setVisibility(View.VISIBLE);
            holder.setText(R.id.tv_three_one, attendRecordBean.remark);
            holder.setText(R.id.tv_four_one, attendRecordBean.accept);
        }else{
            holder.getView(R.id.ll_top).setVisibility(View.GONE);
        }
    }
}
